package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MynewsMapper;
import com.ruoyi.system.domain.Mynews;
import com.ruoyi.system.service.IMynewsService;

/**
 * 每日新闻联播Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-02-01
 */
@Service
public class MynewsServiceImpl implements IMynewsService 
{
    @Autowired
    private MynewsMapper mynewsMapper;

    /**
     * 查询每日新闻联播
     * 
     * @param id 每日新闻联播主键
     * @return 每日新闻联播
     */
    @Override
    @DataSource(value = DataSourceType.SLAVE)
    public Mynews selectMynewsById(Long id)
    {
        return mynewsMapper.selectMynewsById(id);
    }

    @Override
    @DataSource(value = DataSourceType.SLAVE)
    public Mynews selectMynewsByMaxId()
    {
        return mynewsMapper.selectMynewsByMaxId();
    }

    /**
     * 查询每日新闻联播列表
     * 
     * @param mynews 每日新闻联播
     * @return 每日新闻联播
     */
    @Override
    public List<Mynews> selectMynewsList(Mynews mynews)
    {
        return mynewsMapper.selectMynewsList(mynews);
    }

    /**
     * 新增每日新闻联播
     * 
     * @param mynews 每日新闻联播
     * @return 结果
     */
    @Override
    public int insertMynews(Mynews mynews)
    {
        return mynewsMapper.insertMynews(mynews);
    }

    /**
     * 修改每日新闻联播
     * 
     * @param mynews 每日新闻联播
     * @return 结果
     */
    @Override
    public int updateMynews(Mynews mynews)
    {
        return mynewsMapper.updateMynews(mynews);
    }

    /**
     * 批量删除每日新闻联播
     * 
     * @param ids 需要删除的每日新闻联播主键
     * @return 结果
     */
    @Override
    public int deleteMynewsByIds(Long[] ids)
    {
        return mynewsMapper.deleteMynewsByIds(ids);
    }

    /**
     * 删除每日新闻联播信息
     * 
     * @param id 每日新闻联播主键
     * @return 结果
     */
    @Override
    public int deleteMynewsById(Long id)
    {
        return mynewsMapper.deleteMynewsById(id);
    }
}
